﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Management;

namespace PIS.TechGrid.Gadgets.ChangeIP
{
    [Serializable]
    public class IPConfig
    {
        public IPConfig()
        {
            IPAddresses = new MyList<string>();
            IPSubnets = new MyList<string>();
            IPGateways = new MyList<string>();

            DNSServers = new MyList<string>();
        }

        public IPConfig(ManagementObject mo)
        {
            IPAddresses = new MyList<string>(mo["IPAddress"] as string[]);
            IPSubnets = new MyList<string>(mo["ipSubnet"] as string[]);
            IPGateways = new MyList<string>(mo["DefaultIPGateway"] as string[]);

            DNSServers = new MyList<string>(mo["DNSServerSearchOrder"] as string[]);

            MacAddress = mo["MacAddress"] as string;
            Description = mo["Description"] as string;
        }

        public string MacAddress
        {
            get;
            set;
        }

        public string Description
        {
            get;
            set;
        }

        public MyList<string> IPAddresses
        {
            get;
            set;
        }

        public MyList<string> IPSubnets
        {
            get;
            set;
        }

        public MyList<string> IPGateways
        {
            get;
            set;
        }

        public MyList<string> DNSServers
        {
            get;
            set;
        }
    }
}
